package com.xxx.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**用户登录日志实体类**/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("`user_login`")
public class UserLogin {

    /**登录用户id**/
    @ExcelProperty("id")
    @ColumnWidth(20)
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**用户主键**/
    @ExcelProperty("userId")
    @ColumnWidth(20)
    private Integer userId;
    /**登录名**/
    @ExcelProperty("用户名")
    @ColumnWidth(20)
    private String userName;
    /**姓名**/
    @ExcelProperty("姓名")
    @ColumnWidth(20)
    @TableField("`name`")
    private String name;
    /**所属部门**/
    @ExcelProperty("所属部门")
    @ColumnWidth(20)
    private String affiliation;
    /**登录时间**/
    @ExcelProperty("登录时间")
    @ColumnWidth(20)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime loginTime;
    /**登录IP地址**/
    @ExcelProperty("登录ip地址")
    @ColumnWidth(20)
    private String loginIp;
    /**状态**/
    @ExcelProperty("状态")
    @ColumnWidth(20)
    private Integer status;
    @ExcelProperty("是否删除")
    @ColumnWidth(20)
    @TableField("`delete`")
    @TableLogic // 标记为逻辑删除字段
    private Integer delete;

}
